package com.kancy.delay.queue.redis.properties;

/**
 * <p>
 * TopicProperties
 * <p>
 *
 * @author: kancy
 * @date: 2020/3/4 20:07
 **/

public class TopicProperties {

    /**
     * 是否开启
     */
    private boolean enabled = true;

    /**
     * 消息处理器
     * 支持精简名称： "emptyDelayQueueMessageHandler" is equal "empty"
     */
    private String messageHandler = "emptyDelayQueueMessageHandler";

    /**
     * 消息处理器
     * 支持精简名称：
     *  "retryDelayQueueExceptionHandler" is equal "retry"
     *  "reenterDelayQueueExceptionHandler" is equal "reenter"
     */
    private String exceptionHandler = "retryDelayQueueExceptionHandler";

    /**
     * 重试次数
     */
    private Integer maxRetry = 3;

    /**
     * 重试间隔,毫秒
     */
    private Long retryInterval = 1000L;

    /**
     * 每次批量获取的数量 ，小于等于0表示不启用
     */
    private int prefetchSize = 0;

    public boolean isEnabled() {
        return enabled;
    }

    public void setEnabled(boolean enabled) {
        this.enabled = enabled;
    }

    public String getMessageHandler() {
        return messageHandler;
    }

    public void setMessageHandler(String messageHandler) {
        this.messageHandler = messageHandler;
    }

    public String getExceptionHandler() {
        return exceptionHandler;
    }

    public void setExceptionHandler(String exceptionHandler) {
        this.exceptionHandler = exceptionHandler;
    }

    public Integer getMaxRetry() {
        return maxRetry;
    }

    public void setMaxRetry(Integer maxRetry) {
        this.maxRetry = maxRetry;
    }

    public Long getRetryInterval() {
        return retryInterval;
    }

    public void setRetryInterval(Long retryInterval) {
        this.retryInterval = retryInterval;
    }

    public int getPrefetchSize() {
        return prefetchSize;
    }

    public void setPrefetchSize(int prefetchSize) {
        this.prefetchSize = prefetchSize;
    }
}
